{% extends "light.twig" %}
{% block title %}: {{ vocab.title }}{% endblock %}

{% block content %}
{% if lang_supported == false %}
  <div id="lang-info" class="alert alert-danger">
    <h1>!</h1><p>{{ lang_changed }}</p>
  </div>
{% endif %}
<div class="container">
  <div id="vocab-info">
    <div>
      <h1>{% trans "Vocabulary information" %}</h1>
      <hr />
      {% if vocab.info %}
    </div>
    <div class="vocab-info-literals">
      <table class="table">
        {% for key, values in vocab.info %}
        {% set keytrans = key %}
        <tr>
          <th class="versal">{{ keytrans|trans|upper }}</th>
          <td class="versal">
            {% for val in values %}
            <div>{% if val[:7] == 'http://' %}<a href="{{ val }}">{{ val }}</a>{% else %}{{ val|nl2br }}{% endif %}</div>
            {% endfor %}
          </td>
        </tr>
        <tr><td class="property-divider"></td></tr>
        {% endfor %}
        <tr>
          <th class="versal">{{ 'Concepts'|trans|upper }}</th>
          <td class="versal">{{ vocab_stats.concepts }}</td>
        </tr>
        <tr><td class="property-divider"></td></tr>
      </table>
    </div>
    <div>
      <h2>{% trans "Concept counts by language" %}</h2>
      <table class="table" id="statistics">
      <tr>
        <th class="versal">{% trans "Concept language" %}</th>
        <th class="versal">{% trans "Preferred terms" %}</th>
        <th class="versal">{% trans "Alternate terms" %}</th>
        <th class="versal">{% trans "Hidden terms" %}</th>
      </tr>
      {% for lang,stats in vocab_stats['terms'] %}
      <tr>
        <td class="versal">{{ lang }}</td>
        <td class="versal">{{ stats['skos:prefLabel'] }}</td>
        <td class="versal">{{ stats['skos:altLabel'] }}</td>
        <td class="versal">{{ stats['skos:hiddenLabel'] }}</td>
      </tr>
      {% endfor %}
      <tr><td class="property-divider"></td></tr>
      </table>
    </div>
    {% endif %}
    {% if vocab.dataURL %}
    <div><span class="versal"><a href="{{ path_fix }}rest/v1/{{ vocab_id }}/data">{% trans "Download" %}</a> {% trans "this vocabulary as SKOS/RDF" %}</span>
    </div>
    {% endif %}
  </div>
</div>
{% endblock %}
